package com.china08.yxyapi.entity.db.res;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.china08.yxyapi.entity.BaseEntity;

/**
 * 保存文件片段的
 * 
 * @author Json
 *
 */
@Entity
@Table(name = "yxy_res_video_block", catalog = "yxy_res", uniqueConstraints = {
        @UniqueConstraint(columnNames = { "md5", "chunk" }) })
public class YxyResVideoBlock extends BaseEntity {

    private static final long serialVersionUID = -3349087297188607052L;

    @Column(name = "md5", nullable = false, length = 128)
    private String md5;

    @Column(nullable = false)
    private Integer chunk;

    @Column(nullable = false)
    private Integer chunks;

    // 是否合并
    @Column
    private Boolean flag = Boolean.FALSE;

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public Integer getChunk() {
        return chunk;
    }

    public void setChunk(Integer chunk) {
        this.chunk = chunk;
    }

    public Integer getChunks() {
        return chunks;
    }

    public void setChunks(Integer chunks) {
        this.chunks = chunks;
    }

    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

}
